package com.crowd.web.config;

import com.crowd.entity.Admin;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;
import java.util.List;

/**
 * @author Stone
 * @date 2020/6/3 21:40
 */
public class SecurityAdmin extends User {

    private Admin originAdmin;



    // 子类不能重写父类的构造方法
    // 所以，如果要写自己的构造方法，其实也是调用了父类的构造方法
    // 而且，super（）一定要是方法的第一句
    public SecurityAdmin(Admin originAdmin,List<GrantedAuthority> authorities ){
        super(originAdmin.getUserName(),originAdmin.getUserPswd(),authorities);
        this.originAdmin = originAdmin;
    }

    public Admin getOriginAdmin() {
        return originAdmin;
    }

    public void setOriginAdmin(Admin originAdmin) {
        this.originAdmin = originAdmin;
    }



}
